package top.stmo.stmoBlog.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import top.stmo.stmoBlog.dao.vo.DiaryVo;
import top.stmo.stmoBlog.service.DiaryService;

import java.util.List;

@Controller
public class DiaryController {

    @Autowired
    private DiaryService diaryService;

    @GetMapping("diary")
    public String diary(Model model) {
        List<DiaryVo> diaryListVos = diaryService.findDiaryList();
        model.addAttribute("diaryListVos",diaryListVos);
        return "diary";
    }

}
